package com.pro.pojo;

/**
 * @ClassName JsonData
 * @Author 赵
 * @Date 2022/1/7
 */
public class JsonData {
    private int code;
    private String msg;
    private Object data;

    public static JsonData buildSuccess(Object data){
        return new JsonData(0,"",data);
    }

    public static JsonData buildError(String msg){
        return new JsonData(-1,msg);
    }


    public JsonData(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public JsonData(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public JsonData() {
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
